package com.situ.mall.admin.controller;


import com.situ.mall.common.service.IMemberService;
import com.situ.mall.common.vo.TableVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/member")
public class MemberController {

    @Autowired
    private IMemberService memberService;

    @GetMapping("/page")
    public String page(){
        return "member";
    }


    @GetMapping("/list")
    @ResponseBody
    public TableVO list(Integer page, Integer limit, String username, String status){
        return memberService.select(page,limit,username,status);
    }

    @PostMapping("/resetAll")
    @ResponseBody
    public void resetAll(String ids){
        memberService.resetPassword(ids);
    }



    @PostMapping("/updateAll")
    @ResponseBody
    public void updateAll(String ids){
        memberService.updateAll(ids);
    }


}
